package com.ohuang.util_h.replaceActivity;

import android.content.Intent;

/**
*
 * 以下代码会将 activity A 替换成 activity B
 * ReplaceActivity.getInstance().addHandleIntent(new NameHandleIntent("com.xxx.A","com.xxx.B"))
 * ReplaceActivity.getInstance().injectHook();
 *
 */
public class ReplaceActivity {


    private final HCallbackProxy hCallbackProxy = new HCallbackProxy();

    private static final class InstanceHolder {
        private static final ReplaceActivity instance = new ReplaceActivity();
    }
    public static ReplaceActivity getInstance() {
        return InstanceHolder.instance;
    }

    public void addHandleIntent(HandleIntent handleIntent) {
        hCallbackProxy.addHandleIntent(handleIntent);

    }

    public void injectHook() {
        hCallbackProxy.injectHook();
    }
}
